home *** CD-ROM | disk | FTP | other *** search
- /*
- Random number generator used by the standard
- library for the Microsoft C compiler version 5.1.
- */
-
- static unsigned long seed;
-
- void srand(int iseed)
- {
- seed = (unsigned long) iseed << 16;
- }
-
- int rand()
- {
- /*
- ** incidental mod of 2^32 by ignoring
- ** overflow during multiply and add
- */
- seed = seed * 214013L + 2531011L;
- return ((seed >> 16) & 0x7FFF);
- }
-